package com.goldcn.util;


/**
 * Created by 1111 on 2017/2/20.
 * 生成6位或者8位随机数
 */
public class RandomCodeUtils {
    public static int getRandomCode(int code){
        int max=0;
        switch (code){
            case 6:
                max=100000;
                break;
            case 8:
                max=10000000;
                break;
        }
        int randNum = (int)((Math.random()*9+1)*max);
        return randNum;
    }
}
